import React, { Component } from 'react';
import ReactUeditor from 'ifanrx-react-ueditor'

class Editor extends Component{
  constructor(props) {
    super(props);
    this.ueditorRef = null;
  }
  // 初始化ueditior 对象
  getUeditor = ref => {
    this.ueditorRef = ref
  };

  // 获取内容
  getUeditorContent = ref => {
    return this.ueditorRef.getContent()
  };

  // 初始化设置高度
  handleReady = () => {
     // 初始值253
    this.ueditorRef.setHeight(Number(this.props.height))
  };



  render(){
    const {content} = this.props;
    return (
      <ReactUeditor value={content} ueditorPath={'/ueditor1'} getRef={this.getUeditor} onReady={this.handleReady} />
    )
  }
}
export default Editor;

